<template>
	<view>
		<view style="width: 100%; height: 210rpx;background-image: linear-gradient(to top, #ffffff, #46a3e9);display: flex;">
			<view class="mod-img" style="margin-top: 20rpx;margin-left: 16rpx; ">
			    <image src="https://xxzhang.oss-cn-hangzhou.aliyuncs.com/2024/3/c428777cbfee42eeb45b7820e4d3b7a6.jpg" mode="widthFix" class="mod-image"></image>
			</view>
			<view style="margin-left: 30rpx;margin-top: 20rpx;">
				 <view >大洋出品(154515)</view>
				 <view style="margin-top: 20rpx">手机号码：166666666666</view>
			</view>
			<view>
				<image @tap="tuichu" src="../../static/iconfont/tczh.png" style="width: 60rpx;height: 60rpx;margin-top: 30rpx;margin-left: 150rpx;">
				
				</image>
			</view>
		</view>
	
		<view style="display: flex;margin-top: 20rpx;">
			<view style="margin-left: 260rpx;margin-bottom: 10rpx;">观看量(次)</view>
			<view  style="margin-left: 160rpx;margin-bottom: 10rpx;">收益(元)</view>
		</view>
		
		<view style="width: 100%; height: 120rpx;display: flex;background-color: white;">
			<view style="margin-left: 30rpx;margin-top: 50rpx;width: 260rpx;">今日</view>
			<view style="margin-top: 25rpx;width: 260rpx;"><text style="font-size: 60rpx;font-weight: bold;">{{day1}}</text></view>			
		</view>
		<view class="hx" style=" width: 100%;height: 0.3rpx;background-color: rgba(5, 5, 5, 0.2);"></view>
		<view style="width: 100%; height:80rpx;background-color: white;display: flex;">
			<view style="margin-left: 30rpx;margin-top: 25rpx; width: 270rpx;" >昨日</view>
			<view style="margin-top: 25rpx;width: 260rpx;"><text>{{day2}}</text></view>
			<view style="margin-top: 25rpx; "><text>1515</text></view>
		</view>
		<view class="hx" style=" width: 100%;height: 0.3rpx;background-color: rgba(5, 5, 5, 0.2);"></view>
		<view style="width: 100%; height:80rpx;background-color: white;display: flex;">
			<view style="margin-left: 30rpx;margin-top: 25rpx; width: 270rpx;" >近三天</view>
			<view style="margin-top: 25rpx;width: 260rpx;"><text>{{day3}}</text></view>
			<view style="margin-top: 25rpx; "><text>1515</text></view>
		</view>
		<view class="hx" style=" width: 100%;height: 0.3rpx;background-color: rgba(5, 5, 5, 0.2);"></view>
		<view style="width: 100%; height:80rpx;background-color: white;display: flex;">
			<view style="margin-left: 30rpx;margin-top: 25rpx; width: 270rpx;" >近七天</view>
			<view style="margin-top: 25rpx;width: 260rpx;"><text>{{day7}}</text></view>
			<view style="margin-top: 25rpx;"><text>1515</text></view>
		</view>
		<view class="hx" style=" width: 100%;height: 0.3rpx;background-color: rgba(5, 5, 5, 0.2);"></view>
		<view style="width: 100%; height:80rpx;background-color: white;display: flex;">
			<view style="margin-left: 30rpx;margin-top: 25rpx; width: 270rpx;" >近一个月</view>
			<view style="margin-top: 25rpx;width: 260rpx;"><text>{{day30}}</text></view>
			<view style="margin-top: 25rpx;"><text>1515</text></view>
		</view>
		<view class="hx" style=" width: 100%;height: 0.3rpx;background-color: rgba(5, 5, 5, 0.2);"></view>
		<view style="display: flex;margin-top: 20rpx;">
			<view style="margin-left: 40%;margin-bottom: 10rpx;">统计</view>
		</view>
		<view style="width: 100%; height:80rpx;background-color: white;display: flex;">
			<view style="margin-left: 30rpx;margin-top: 25rpx; width: 270rpx;" >总课件</view>
			<view style="margin-top: 25rpx;width: 260rpx;"><text>{{coursewareNum}}</text></view>
		</view>
		<view class="hx" style=" width: 100%;height: 0.3rpx;background-color: rgba(5, 5, 5, 0.2);"></view>
		<view style="width: 100%; height:80rpx;background-color: white;display: flex;">
			<view style="margin-left: 30rpx;margin-top: 25rpx; width: 270rpx;" >总观看量</view>
			<view style="margin-top: 25rpx;width: 260rpx;"><text>{{viewingVolume}}</text></view>
		</view>
		<view class="hx" style=" width: 100%;height: 0.3rpx;background-color: rgba(5, 5, 5, 0.2);"></view>
		<view style="width: 100%; height:80rpx;background-color: white;display: flex;">
			<view style="margin-left: 30rpx;margin-top: 25rpx; width: 270rpx;" >总收入</view>
			<view style="margin-top: 25rpx;width: 260rpx;"><text>548485</text></view>
		</view>
		<view class="hx" style=" width: 100%;height: 0.3rpx;background-color: rgba(5, 5, 5, 0.2);"></view>
		
	
		
   </view>
</template>

<script>
const app = getApp();
var urlPrefix = app.globalData.urlPrefix;
export default {
    data() {
        return {
          day1:0,
		  day2:0,
		  day3:0,
		  day7:0,
		  day30:0,
		  viewingVolume:0,
		  coursewareNum:0
        };
    }
	
	
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad(options) {
		var id = uni.getStorageSync('lecturerId');
		var token = uni.getStorageSync('token');
		this.token = token;
		let that = this;
		if (id) {
		    uni.request({
		        url: urlPrefix + '/api/app/lecturerModule/lecturerModuleInfo?id=' + id,
		        method: 'GET',
		        header: {
		            'content-type': 'application/json',
		             'token': this.token
		        },
		        success: function (res) {
					  let dataList = res.data;
		            if (dataList.resp_code == 0) {
		                that.setData({
		                    day1: dataList.datas.day1,
		                    day2: dataList.datas.day2,
		                    day3: dataList.datas.day3,
		                    day7: dataList.datas.day7,
							day30: dataList.datas.day30,
							viewingVolume: dataList.datas.viewingVolume,
							coursewareNum: dataList.datas.coursewareNum
							
		                });
		            }
		        }
		    });
		}
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {
		uni.navigateBack({
			delta:3
		})
	},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {},
	methods: {
			  tuichu(){
				  uni.removeStorageSync("lecturerToken");
				  uni.redirectTo({
					url: "/pages/applyFor/applyFor",
				  })
			  },
	}

};
</script>
<style lang="scss">
@import './lecturerInfo.scss';
</style>